package <%= config.basePackage %>entity;

<% entityImportList.forEach(function(item) { %>
    import <%= item %>;
<% }) %>
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

/**
* @author <%= config.author %>
* @date  <%= config.date %>
* @description <%= table.tableName %> <%= table.tableComment %>实体类
* Generated By: uToolsPlugin SqlConvert
* Lesscoding Generate Service
* @version: 0.0.5
* Link to: <a href="https://lesscoding.net">https://lesscoding.net</a>
* mail to:2496290990@qq.com
*/
<% if(config.lombok) { %>
    @Data
<% } %>
<% if(config.swagger === "knife4j") { %>
@ApiModel(value = "<%= table.tableComment %>",parent = <%= simpleSuperClass %>.class)
<% } %>
@TableName("<%= table.tableName %>")
public class <%= table.className %> extends <%= simpleSuperClass %>{
<% columnList.forEach(function (item) { %>
    /**
    * <%= item.comment %>
    */
    <% if(item.dateCol) { %>
    @JsonFormat(pattern = "<%= pattern %>")
    @DateTimeFormat(pattern = "<%= pattern %>")
    <% } %>
    <% if(config.swagger === "knife4j") { %>
        @ApiModelProperty(name =  "<%= item.comment %>")
    <% } %>
    <% if(item.field === primaryKey.field) {%>
    @TableId
    <% }%>
    private <%= item.javaType %> <%= item.field %>;
    <%=   %>
<% }) %>
<% if(config.page === 'mybatisPage'){%>
    @TableField(exist = false)
    private PageDTO page;
<% }%>
<% if(config.page === 'pageHelper'){%>
    @TableField(exist = false)
    private Integer currentPage;

    @TableField(exist = false)
    private Integer pageSize;
<% }%>
<% if (!config.lombok) { %>
    <% columnList.forEach(function (item) { %>
    public void set<%= item.camelCaseField %>(<%= item.javaType %> <%= item.field %>){
        this.<%= item.field %> = <%= item.field %>;
    }

    public <%= item.javaType %> get<%= item.camelCaseField %>(){
        return <%= item.field %>;
    }
    <% }) %>
    <% if(config.page === 'mybatisPage'){%>
        public void setPage(PageDTO page) {
            this.page = page;
        }
        public PageDTO getPage() {
            return page;
        }
    <% }%>
    <% if(config.page === 'pageHelper'){%>
        public void setCurrentPage(Integer currentPage) {
            this.currentPage = currentPage;
        }
        public Integer getCurrentPage() {
            return currentPage;
        }
        public void setPageSize(Integer pageSize) {
            this.pageSize = pageSize;
        }
        public Integer getPageSize() {
            return pageSize;
        }
    <% }%>
<% } %>
}
